﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Views_MainForm : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.MaintainScrollPositionOnPostBack = true;
        if (Request.Cookies["Login"] != null)
        {
            lbHello.Text = "Welcom: " + Request.Cookies["Login"]["FullName"].ToString();
        }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        String keyWord = txtSearch.Text;
        String searchBy = null;

        if (rdbtnSearchByName.Checked)
        {
            searchBy = "Tit";
        }
        if (rdbtnByAuthor.Checked)
        {
            searchBy = "Au";
        }
        Response.Redirect("SearchResult.aspx?Key=" + keyWord + "&SearchBy=" + searchBy);
    }
}
